var fetch7 = function (pageIndex ,callback){
  pageIndex = pageIndex || 1
  // frequentRoomChangersTable	住所频繁更换
  $.ajax({
    type: 'GET',
    url: personInfo.ajaxUrl[1].page(pageIndex,10),
    beforeSend: function (xhr) {
      xhr.setRequestHeader('Authorization', tokenPgAuth);
      xhr.setRequestHeader('Accept-Profile', 'api-ailock-analysis-v1');
      xhr.setRequestHeader('Prefer', 'count=exact');
    }
  }).done(function (response,type,request1) {
    personInfo.total[1] = pgApiUtils.getTotal(request1); // 的总数
    $('.' + personInfo.totalDomId[1] + 1).text(personInfo.total[1])
    $('#' + personInfo.totalDomId[1] + 2).text(personInfo.total[1])

    //一房多人的总数 总数使用在slider里面一个 图标一个 分页处三个地方
    var options = {
      bDestroy:true,
      searching: false,
      bPaginate: true ,//表格分页
      bSort: false,
      bLengthMenu: false,
      bInfo: false,
      pageLength:10, // 每页显示数量
      bAutoWidth: false,
      bLengthChange: false,
      bProcessing: true,
      pgAiDisplayLength:personInfo.total[1],
      data: response,
      fnPageChange:function(settings){
        // 这个有好几块
        changePage(settings,'.frequentRoomChangersTable',[0,2], personInfo)
      },
      columns: [
        {
          data: "name",
          bSortable: false,
          className: 'ta',
          render: function (data, type, full, meta) {
            if (!data) data = '--';
            return data
          }
        },
        {
          data: "phones",
          class: 'digit ta',
          bSortable: false,
          render: function (data, type, full, meta) {
            if (!data) data = '--';
            return data
          }
        },
        {
          data: "tally_house_sessions",  //此处为变动房间数量
          align: 'left',
          className: 'ta',
          bSortable: false,
          render: function (data, type, full, meta) {
            if (!data) data = '--';
            return data
            //     return full.stats_per_lock_for_active_formal.tally_keys ? full.stats_per_lock_for_active_formal.tally_keys: '--'
          }
        },

      ],
    };
    options.fnInitComplete =  function (settings) {

        var myOptions = jQuery.extend(options, {
          fnPageChange : function(settings){
            changePage(settings,'.frequentRoomChangersTable',[1,2], personInfo)
          },
          fnInitComplete : function(settings){
            var newOptions = jQuery.extend(options, {
              fnPageChange : function(settings){
                changePage(settings,'.frequentRoomChangersTable',[0,1], personInfo)
              },
              fnInitComplete : function(settings){
                personInfo.bindEvent[1]()
              }
            })

            personInfo.tables[1][2] = $('.frequentRoomChangersTable').eq(2).dataTable(newOptions);
          }
        });
        personInfo.tables[1][0] =  $('.frequentRoomChangersTable').eq(0).dataTable(myOptions);

    }

    personInfo.tables[1][1] = $('.frequentRoomChangersTable').eq(1).dataTable(options);

  })
}




personInfo.bindEvent[1] = function () {
  $(".frequentRoomChangersTable").each(function (index,item){
    $(item).on("click","tr",function(){//给tr或者td添加click事件
      var data=personInfo.tables[1][index].api().row(this).data();//获取值的对象数据
      frequentRoomChanger(data,7)
    })
  })
}
